﻿using STHPMS1.DAL.D_Core;
using System.Data;
using ServiceStack.OrmLite;
using STHPMS1.ICore.I_Entity.Stmpms1;
using STHPMS1.Common.C_Entity.Stmpms1;
using STHPMS1.ICore.I_DAL.Repository;
using System.Collections.Generic;
namespace STHPMS1.DAL.D_Repository
{
    public class Df_Dailymian_CostRepository : DalBase, IDf_Dailymian_CostRepository
    {
        /// <summary>
        /// 获取路面日常养护单价
        /// </summary>
        /// <param name="pvmttype">路面类型</param>
        /// <param name="rd_class">技术等级</param>
        /// <param name="year">通车年限</param>
        /// <returns></returns>
        public double GetDaily_Unitcost(int pvmttype, string rd_class,int year)
        {
            IDbConnection conn = Adapter.OpenDbConnection();
            string strsql = "select DAILY_UNITCOST from DF_DAILYMIAN_COST where PVMTTYPE=" + pvmttype + " and RD_CLASS like '%" + rd_class + "%' and MINYEAR<=" + year + " AND MAXYEAR>" + year + "";
            return conn.Scalar<double>(strsql);
        }
    }
}
